package com.edushare.common.mailer;

import com.edushare.common.constants.ApplicationConstants;
import com.edushare.common.vo.OutgoingEmails;
import com.edushare.common.vo.TempUsers;

public class UnivRegistrationMailer extends MailStringLoader {

	private String mailString = MailBase.get().stringMap.get(MailBase.NEW_UNIV_REGISTRATION);
	private TempUsers tempUser;
		
	public UnivRegistrationMailer(TempUsers tu, String regUrl){
		this.tempUser = tu;
		replaceMap.put("USER_NAME", tu.getFirstName());
		replaceMap.put("ACTIVATION_URL", regUrl);
		messageString = templateParser(mailString, replaceMap);
	}
	
	@Override
	public OutgoingEmails send() {
		OutgoingEmails mail = new OutgoingEmails();
		mail.setContent(messageString);
		mail.setReceiverEmailId(tempUser.getEmail());
		mail.setStatus(OutgoingEmails.EMAIL_TO_BE_SENT);
		mail.setCopyType(1);
		mail.setSubject("Welcome to " + ApplicationConstants.APPLICATION_NAME);
		return mail;	
	}

}
